"""
参数数据模型
"""
from typing import Dict, List, Any, Optional
from pydantic import BaseModel, Field


class Parameter(BaseModel):
    """
    参数数据模型
    """
    name: str
    display_name: str
    description: str = ""
    param_type: str  # number, string, boolean, select
    required: bool = False
    default_value: Optional[Any] = None
    min_value: Optional[float] = None
    max_value: Optional[float] = None
    min_length: Optional[int] = None
    max_length: Optional[int] = None
    step: Optional[float] = None
    options: Optional[List[Dict[str, Any]]] = None
    multiline: bool = False
    
    class Config:
        arbitrary_types_allowed = True


class ParameterGroup(BaseModel):
    """
    参数组数据模型
    """
    id: str
    name: str
    description: str = ""
    parameters: List[Parameter] = Field(default_factory=list)
    
    class Config:
        arbitrary_types_allowed = True